package work20240725;

import java.util.*;


public class function6 {
    public static void main(String[] args) {
        removeArr();
    }
    public static void removeArr() {
        int[] a1 = {1,2,3};
        int[] a2 = {3,4,5,2};
        List<Integer> arr = new ArrayList<>();
        Arrays.stream(a1).forEach(arr::add);

        Arrays.stream(a2).forEach(s ->{
            if(arr.contains(s)){
                arr.remove(Integer.valueOf(s));
            } else{
                arr.add(s);
            }
        });
        arr.forEach(System.out::println);
    }
}
